package scau.hotel.hotel_service.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import scau.hotel.hotel_service.validator.IsIDCard;
import scau.hotel.hotel_service.validator.IsMobilePhone;
import scau.hotel.hotel_service.validator.IsName;
import scau.hotel.hotel_service.validator.IsPositiveInteger;

import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.io.Serializable;

/**
 * (Book)实体类
 *
 * @author makejava
 * @since 2022-04-22 13:36:13
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Book implements Serializable {
    private static final long serialVersionUID = -33098320085689189L;
    /**
     * 预定id
     */
    private Integer bookId;
    /**
     * 预定人姓名
     */
    @NotNull(message = "姓名不能为空")
    @IsName
    private String cusName;
    /**
     * 预定人身份证
     */
    @NotNull(message = "身份证不能为空")
    @IsIDCard
    private String cusIdcard;
    /**
     * 预订人电话
     */
    @NotNull(message = "电话号码不能为空")
    @IsMobilePhone
    private String cusTel;
    /**
     * 房型id
     */
    private Integer roomTypeId;
    /**
     * 预定房型数量
     */
    @NotNull(message = "预定房型数量不能为空")
    @Max(value = 5, message = "最多只能预定5间房")
    private Integer bookNum;
    /**
     * 预计入住时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd hh:mm:ss")
    private Date checkinDate;
    /**
     * 预计退房时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd hh:mm:ss")
    private Date checkoutDate;
    /**
     * 备注
     */
    private String remark;
    /**
     * 状态：0代表未入住，1代表已入住
     */
    private String status;
    /**
     * 删除标志：0代表删除，1代表存在
     */
    private Integer delFlag;
    /**
     * 创建人
     */
    private String createdBy;
    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd hh:mm:ss")
    private Date createTime;
    /**
     * 更新人
     */
    private String updatedBy;
    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd hh:mm:ss")
    private Date updateTime;
    /**
     * roomType:book为1:N
     */
    private RoomType roomType;

}

